%li
  .pull-right
    - if @available_keys.include?(deploy_key)
      = link_to enable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-small', method: :put do
        %i.fa.fa-plus
        Enable
    - else
      - if deploy_key.projects.count > 1
        = link_to disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-small', method: :put do
          %i.fa.fa-power-off
          Disable
      - else
        = link_to 'Remove', namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), data: { confirm: 'You are going to remove deploy key. Are you sure?'}, method: :delete, class: "btn btn-remove delete-key btn-small pull-right"


  - key_project = deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first
  = link_to namespace_project_deploy_key_path(key_project.namespace, key_project, deploy_key) do
    %i.fa.fa-key
    %strong= deploy_key.title

  %p.light.prepend-top-10
    - deploy_key.projects.map(&:name_with_namespace).each do |project_name|
      %span.label.label-gray.deploy-project-label= project_name
    %small.pull-right
      Created #{time_ago_with_tooltip(deploy_key.created_at)}
